<template>
  <el-tabs v-model="activeName" type="border-card" @tab-change="handleTabChange">
    <el-tab-pane label="我代理的待办" name="todo">
      <MyTodoProxy ref="myTodoProxy"></MyTodoProxy>
    </el-tab-pane>
    <el-tab-pane label="我代理的已办" name="done">
      <MyDoneProxy ref="myDoneProxy"></MyDoneProxy>
    </el-tab-pane>
    <el-tab-pane label="代理我的已办" name="delegateDone">
      <ProxyMe ref="proxyMeDone"></ProxyMe>
    </el-tab-pane>
    <el-tab-pane label="代理人配置" name="config">
      <ProxyConfig ref="proxyConfig"></ProxyConfig>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import ProxyConfig from "@/platform/wf/views/wf/task/proxy/proxyConfig.vue";
import MyTodoProxy from "@/platform/wf/views/wf/task/proxy/myTodoProxy.vue";
import MyDoneProxy from "@/platform/wf/views/wf/task/proxy/myDoneProxy.vue";
import ProxyMe from "@/platform/wf/views/wf/task/proxy/proxyMeDone.vue";

export default {
  components: {ProxyConfig, MyTodoProxy, MyDoneProxy, ProxyMe},
  data() {
    return {
      activeName: 'todo'
    };
  },
  methods: {
    handleTabChange(name) {
      switch (name) {
        case 'todo':
          this.$refs.myTodoProxy.getList();
          break;
        case 'done':
          this.$refs.myDoneProxy.getList();
          break;
        case 'delegateDone':
          this.$refs.proxyMeDone.getList();
          break;
        case 'config':
          this.$refs.proxyConfig.getProxyTargetList();
          this.$refs.proxyConfig.getProxyList();
          break;
        default:
          break;
      }
    }
  }
};

</script>

<style lang="scss" scoped>

</style>
